package com.keepers.repair.helper;

import android.content.Context;
import android.media.Ringtone;
import android.media.RingtoneManager;
import android.net.Uri;

import com.keepers.repair.R;

/**
 * auth aboom
 * date 2018/11/25
 */
public class SoundPlayerHelper {

    public static void callOutBegin(Context context) {
        Uri notification = Uri.parse("android.resource://" + context.getPackageName() + "/" + R.raw.sound_media_me_on);
        Ringtone r = RingtoneManager.getRingtone(context, notification);
        r.play();
    }

    public static void callOutEnd(Context context) {
        Uri notification = Uri.parse("android.resource://" + context.getPackageName() + "/" + R.raw.sound_media_me_off);
        Ringtone r = RingtoneManager.getRingtone(context, notification);
        r.play();
    }

    public static void callInBegin(Context context) {
        Uri notification = Uri.parse("android.resource://" + context.getPackageName() + "/" + R.raw.sound_media_other_on);
        Ringtone r = RingtoneManager.getRingtone(context, notification);
        r.play();
    }

    public static void callInEnd(final Context context) {
        Uri notification = Uri.parse("android.resource://" + context.getPackageName() + "/" + R.raw.sound_media_other_off);
        Ringtone r = RingtoneManager.getRingtone(context, notification);
        r.play();
    }

    public static void registerOK(final Context context) {
        Uri notification = Uri.parse("android.resource://" + context.getPackageName() + "/" + R.raw.sound_pti);
        Ringtone r = RingtoneManager.getRingtone(context, notification);
        r.play();
    }
}
